package com.customization.api.pdf2word;

import com.baidu.aip.ocr.AipOcr;
import org.json.JSONObject;

import java.util.HashMap;

public class BaiDuSimaple {


        //设置APPID/AK/SK
        public static final String APP_ID = "20088153";
        public static final String API_KEY = "j4m5lEFtYdaatOstrF9SzyLd";
        public static final String SECRET_KEY = "MM88YvkTxFo1qPdaz4b0SnbS38Q43aK6";
        public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";

        public static void main(String[] args) {
            // 初始化一个AipOcr
            AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);

            // 可选：设置网络连接参数
            client.setConnectionTimeoutInMillis(2000);
            client.setSocketTimeoutInMillis(60000);



            // 调用接口
            String path = "/Users/liutaihong/Downloads/2016.11.9百钻.jpg";
            JSONObject res = client.basicGeneral(path, new HashMap<String, String>());
            System.out.println(res.toString(2));

        }

}
